﻿using mscook.core.domain;
using mscook.core.repositories;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace mscook.core.services
{
    public class BulletinService : mscook.core.services.IBulletinService
    {
        private IBulletinRepository iBulletinRepository;

        public BulletinService(IBulletinRepository iBulletinRepository)
        {
            this.iBulletinRepository = iBulletinRepository;
        }

        public void SaveOrUpdate(Bulletin Bulletin)
        {
            iBulletinRepository.SaveOrUpdate(Bulletin);
        }

        public Bulletin Get(string id)
        {
            return iBulletinRepository.Get(id);
        }

        public IList<Bulletin> SelectPageList(int start, int limit, out long total)
        {
            return iBulletinRepository.SelectPageList(start, limit, out  total);
        }

        public IList<Bulletin> GetByType(string type,int start, int limit)
        {
            return iBulletinRepository.GetByType(type,start,limit);
        }

        public bool Delete(string id)
        {
            return iBulletinRepository.Delete(id);
        }

        public IList<Bulletin> GetByExit(IList<string> exitIds, int start, int limit, out long total)
        {
            return iBulletinRepository.GetByExit(exitIds,start,limit,out total);
        }
    }
}
